package core.product.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import core.profile.model.BasicProfile;

@Entity
@Table(name="ratingandreview")
public class RatingAndReview implements Serializable
{
	private static final long serialVersionUID = -8767337896773261248L;
	private Long uuid;
	private String review ;
	private int rating ;
	private BasicProfile reviewer ;
	private Product product ;
	
	@ManyToOne(cascade = CascadeType.ALL)
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	@Id
	@GeneratedValue
	@Column(name="uuid")
	public Long getUuid() {
		return uuid;
	}
	public void setUuid(Long uuid) {
		this.uuid = uuid;
	}
	@Column(name="review",length=9000)
	public String getReview() {
		return review;
	}
	public void setReview(String review) {
		this.review = review;
	}
	@Column(name="rating")
	public int getRating() {
		return rating;
	}
	public void setRating(int rating) {
		this.rating = rating;
	}
	@ManyToOne(cascade = CascadeType.ALL)
	public BasicProfile getReviewer() {
		return reviewer;
	}
	public void setReviewer(BasicProfile reviewer) {
		this.reviewer = reviewer;
	}
}
